import 'dart:convert';

import 'package:common_utils/common_utils.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBJsonToModel/YBMineModel/YBMineAuthVipModel.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBJsonToModel/YBMineModel/YBMineIDDetailModel.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBJsonToModel/YBMineModel/YBMineOrginzationManagerModel.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBJsonToModel/YBMineModel/YBMineShareHuiModel.dart';

class YBMineUserInfoModel {
  String customerCode;
  String avatarUrl;
  String customerPhone;
  String customerName;
  String imageUrl;
  String provinceName;
  String cityName;
  String certAddress;
  String nickName;
  String wxNumber;
  String contactPerson;
  String customerCapital;
  String contactPersonPhone;
  String email;
  String wxQrCode;
  int orgMaxNumber;
  int useOrgNumber;
  String customerTime;
  String legalPerson;
  String certLinkName;
  String certLinkPhone;
  String certCredUrl;
  String certIndustry;
  String certQualifications;
  bool haveOrg;
  String certIdPhoto;
  int totalShareCount;
  int totalShareByClickCount;
  String unionid;
  String creditCode;
  List tagCodeSet;

  int certStatus;
  int customerType;
  List<YBMineAuthVipModel> customerAuthorities;
  List<YBMineOrginzationManagerModel> orgList;
  YBMineShareHuiModel rmtArticle;
  YBMineIDDetailModel idDetail;


  YBMineUserInfoModel({this.customerCode,this.avatarUrl,this.customerPhone,this.certStatus});

  YBMineUserInfoModel.fromJson(Map<String, dynamic>json){
    customerCode = json['customerCode'];
    avatarUrl = json['avatarUrl'];
    nickName = json['nickName'];
    customerPhone = json['customerPhone'];
    customerName = json['customerName'];
    certStatus = json['certStatus'];
    customerType = json['customerType'];
    useOrgNumber = json['useOrgNumber'];
    orgMaxNumber = json['orgMaxNumber'];
    creditCode = json['creditCode'];
    contactPerson = json['contactPerson'];
    contactPersonPhone = json['contactPersonPhone'];
    email = json['email'];

    wxNumber = json['wxNumber'];
    wxQrCode = json['wxQrCode'];
    unionid = json['unionid'];
    certLinkName = json['certLinkName'];
    certLinkPhone = json['certLinkPhone'];
    customerCapital = json['customerCapital'];
    customerTime = json['customerTime'];
    legalPerson = json['legalPerson'];
    certIndustry = json['certIndustry'];
    certCredUrl = json['certCredUrl'];
    certQualifications = json['certQualifications'];

    if (json["tagCodeSet"] != null){
      tagCodeSet = List();
      tagCodeSet.addAll(json["tagCodeSet"]);
    }

    if (json['customerAuthorities'] != null) {
       customerAuthorities = List<YBMineAuthVipModel>();
       json['customerAuthorities'].forEach((e){
         customerAuthorities.add(YBMineAuthVipModel.fromJson(e));
       });
    }

    if (json['orgList'] != null) {
       orgList = List<YBMineOrginzationManagerModel>();
       (json['orgList'] as List).forEach((element) {
          orgList.add(YBMineOrginzationManagerModel.fromJson(element));
       });
    }

    if (json['rmtArticle'] != null) {
       rmtArticle = YBMineShareHuiModel.fromJson(json['rmtArticle']);
    }

    if (json['idDetail'] != null) {
       String idDetailStr = json['idDetail'];
       JsonUtil.getObj(idDetailStr, (v){
         if (v != null) {
           idDetail = YBMineIDDetailModel.fromJson(v);
         }
       });
    }
  }

}